Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vinyl-sourcemaps-apply

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vinyl-sourcemaps-apply

Apply a source map to a vinyl file, merging it with preexisting source maps

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
986K
increased by3.03%
Maintainers
1
Weekly downloads
 
Created

What is vinyl-sourcemaps-apply?

The vinyl-sourcemaps-apply npm package is used to apply source maps to vinyl files, which are used in the Gulp build system. This package helps in maintaining the mapping between the original source code and the transformed code, which is useful for debugging purposes.

What are vinyl-sourcemaps-apply's main functionalities?

Apply Source Maps

This feature allows you to apply a source map to a vinyl file. The code sample demonstrates creating a vinyl file object, creating a source map consumer, and then applying the source map to the vinyl file using the vinyl-sourcemaps-apply package.

const applySourceMap = require('vinyl-sourcemaps-apply');
const vinylFile = require('vinyl');
const sourceMap = require('source-map');

// Create a vinyl file object
const file = new vinylFile({
  cwd: '/',
  base: '/test/',
  path: '/test/file.js',
  contents: Buffer.from('test content'),
  sourceMap: {
    version: 3,
    file: 'file.js',
    sources: ['file.coffee'],
    names: [],
    mappings: 'AAAA'
  }
});

// Create a source map consumer
const map = new sourceMap.SourceMapConsumer(file.sourceMap);

// Apply the source map to the vinyl file
applySourceMap(file, map);

Other packages similar to vinyl-sourcemaps-apply

Keywords

FAQs

Package last updated on 27 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc